package ch.exm.storm.conditions;


public class Equal extends TwoArgumentsCondition {

	public Equal(Object first, Object second) {
		super(first, second);
	}
	
	@Override
	public boolean matches(Object firstValue, Object secondValue) {
		if (firstValue == null && secondValue == null) return true;
		if (firstValue == null || secondValue == null) return false;
		return firstValue.equals(secondValue);
	}

	@Override
	protected String getConditionKeyword() {
		return (" = ");
	}
	
	@Override
	protected String getInverseConditionKeyword() {
		return (" != ");
	}

	public static Equal areEqual(Object first, Object second) {
		return new Equal(first, second);
	}
}
